/*************************************************************************
> File Name: main.cpp
> Author:
> Mail:
> Created Time: Mon 28 Aug 2017 08:24:39 AM CST
************************************************************************/

#include <iostream>
using namespace std;
int sum = 0;
int change[4][2] =
    {
        {0, 1},
        {0, -1},
        {1, 0},
        {-1, 0}};
int map[56][56];
struct note
{
    int x;
    int y;
} q[2536];
int head = 0, tail = 0;
int area = 0;

int main()
{
    int n, m, sx, sy;
    cin >> n >> m >> sx >> sy;
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < m; ++j)
        {
            cin >> map[i][j];
        }
    }

    q[tail].x = sx;
    q[tail].y = sy;
    area += map[sx][sy];
    map[sx][sy] = -1;
    tail++;
    sum++;
    while (head < tail)
    {
        for (int t = 0; t < 4; t++)
        {
            int nx = q[head].x + change[t][0];
            int ny = q[head].y + change[t][1];
            if (nx >= 0 && nx < n && ny >= 0 && ny < m && map[nx][ny] > 0)
            {
                q[tail].x = nx;
                q[tail].y = ny;
                area += map[nx][ny];
                tail++;
                map[nx][ny] = -1;
                sum++;
            }
        }
        head++;
    }
    cout << area << endl
         << sum << endl;
    return 0;
}

/*

10 10 6 8
1 2 1 0 0 0 0 0 2 3
3 0 2 0 1 2 1 0 1 2
4 0 1 0 1 2 3 2 0 1
3 2 0 0 0 1 2 4 0 0
0 0 0 0 0 0 1 5 3 0
0 1 2 1 0 1 5 4 3 0
0 1 2 3 1 3 6 2 1 0
0 0 3 4 8 9 7 5 0 0
0 0 0 3 7 8 6 0 1 2
0 0 0 0 0 0 0 0 1 0
*/